using System;
using System.Collections.Generic;
using Ioc.Kernel.LifeStyles;

namespace Ioc.Kernel
{
    public interface IIocContainer : IDisposable
    {
        IDictionary<ContainerKey, ComponentModel> Components { get; }

        /// <summary>
        /// Adds the component.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="className">Name of the class.</param>
        void AddComponent(string name, Type className);

        /// <summary>
        /// Adds the component.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="className">Name of the class.</param>
        /// <param name="lifecycle">The lifecycle.</param>
        void AddComponent(string name, Type className, LifeStyleType lifecycle);

        /// <summary>
        /// Adds the component.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="className">Name of the class.</param>
        /// <param name="parameters">The parameters.</param>
        void AddComponent(string name, Type className, IList<Parameter> parameters);

        /// <summary>
        /// Adds the component.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="className">Name of the class.</param>
        /// <param name="lifecycle">The lifecycle.</param>
        /// <param name="parameters">The parameters.</param>
        void AddComponent(string name, Type className, LifeStyleType lifecycle, IList<Parameter> parameters);

        /// <summary>
        /// Adds the component.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="className">Name of the class.</param>
        /// <param name="serviceName">Name of the service.</param>
        void AddComponent(string name, Type className, Type serviceName);

        /// <summary>
        /// Adds the component.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="className">Name of the class.</param>
        /// <param name="serviceName">Name of the service.</param>
        /// <param name="lifecycle">The lifecycle.</param>
        void AddComponent(string name, Type className, Type serviceName, LifeStyleType lifecycle);

        /// <summary>
        /// Adds the component.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="className">Name of the class.</param>
        /// <param name="serviceName">Name of the service.</param>
        /// <param name="parameters">The parameters.</param>
        void AddComponent(string name, Type className, Type serviceName, IList<Parameter> parameters);

        /// <summary>
        /// Adds the component.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="className">Name of the class.</param>
        /// <param name="serviceName">Name of the service.</param>
        /// <param name="lifecycle">The lifecycle.</param>
        /// <param name="parameters">The parameters.</param>
        void AddComponent(string name, Type className, Type serviceName, LifeStyleType lifecycle,IList<Parameter> parameters);

        /// <summary>
        /// Resolves this instance.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        T Resolve<T>();

        /// <summary>
        /// Resolves the specified component name.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="componentName">Name of the component.</param>
        /// <returns></returns>
        T Resolve<T>(string componentName);

        /// <summary>
        /// Removes the component.
        /// </summary>
        /// <param name="componenteId">The componente id.</param>
        void RemoveComponent(string componenteId);

        /// <summary>
        /// Removes all components.
        /// </summary>
        void RemoveAllComponents();
    }
}